// $Id: RenditionDetailPage.java 11 2011-09-08 21:03:19Z huijzer@gmail.com $
package lime.browser.editor;

import lime.model.Rendition;

import org.eclipse.swt.widgets.Text;

public class RenditionDetailPage extends RepositoryObjectDetailPage {

	// Widgets
	Text objectIdText;
	Text fullFormatText;
	Text contentSizeText;
	Text setTimeText;
	Text setFileText;

	public RenditionDetailPage() {
		super("Rendition details");
	}
	
	@Override
	public void addTextWidgets() {
		objectIdText = addTextWidget("Object ID: ");
		fullFormatText = addTextWidget("Full format: ");
		contentSizeText = addTextWidget("Content size: ");
		setTimeText = addTextWidget("Set time: ");
		setFileText = addTextWidget("Set file: ");
	}
	
	@Override
	public void update() {

		Rendition rendition = (Rendition) getInput();
		
		if (rendition != null) {
			objectIdText.setText(rendition.getObjectId());
			fullFormatText.setText(rendition.getFullFormat());
			contentSizeText.setText(rendition.getContentSize());
			setTimeText.setText(rendition.getSetTime());
			setFileText.setText(rendition.getSetFile());
		}
	}
}
